42 #include <opencv2/core/core.hpp>
46 #define CAMERA_GROUP ("camera")
47 #define CAMERA_NUM_CHANNELS_KEY ("num_channels")
48 #define CAMERA_CHANNEL_GROUP_PREFIX ("channel_")
49 #define CAMERA_CHANNEL_TYPE_KEY ("type")
51 #define CAMERA_CHANNEL_TYPE_HSV_KEY ("hsv")
52 #define CAMERA_CHANNEL_TYPE_QR_KEY ("qr")
68 const double &confidence,
const char *data = 0,
69 const size_t &dataLength = 0);
75 const double confidence()
const;
76 const char *data()
const;
77 const size_t dataLength()
const;
95 void setImage(
const cv::Mat &image);
99 virtual void update(
const cv::Mat &image) = 0;
111 virtual void setImage(
const cv::Mat &image) = 0;
112 virtual ChannelImpl *channelImpl(
const std::string &name) = 0;
121 virtual void setImage(
const cv::Mat &image);
122 virtual ChannelImpl *channelImpl(
const std::string &name);
125 std::map<std::string, ChannelImpl *> m_channelImpls;
143 void setConfig(
const Config &config);
150 mutable bool m_valid;
158 static std::string extension();
160 static void setBasePath(
const std::string &path);
161 static std::string path(
const std::string &name = std::string());
162 static std::string defaultPath();
163 static std::string defaultConfigPath();
164 static void setDefaultConfigPath(
const std::string &name);
167 static std::string s_path;
174 virtual bool open(
const int number) = 0;
175 virtual bool isOpen()
const = 0;
176 virtual void setWidth(
const unsigned width) = 0;
177 virtual void setHeight(
const unsigned height) = 0;
178 virtual bool next(cv::Mat &image) = 0;
179 virtual bool close() = 0;
188 virtual bool open(
const int number);
189 virtual bool isOpen()
const;
190 virtual void setWidth(
const unsigned width);
191 virtual void setHeight(
const unsigned height);
192 virtual bool next(cv::Mat &image);
193 virtual bool close();
196 cv::VideoCapture *m_capture;
205 bool open(
const int number = 0);
210 void setWidth(
const unsigned width);
211 void setHeight(
const unsigned height);
213 unsigned width()
const;
214 unsigned height()
const;
219 const cv::Mat &rawImage()
const;
221 void setConfig(
const Config &config);
222 const Config &config()
const;
227 const unsigned char *bgr()
const;
237 timeval m_lastUpdate;
239 mutable unsigned char *m_bgr;
240 mutable unsigned m_bgrSize;